Launching PC-DMIS Using C++
// Create my startup file int nIndex; CString szFileName, szLine(_T("/f")); GetModuleFileName (AfxGetInstanceHandle(), szFileName.GetBuffer (_MAX_PATH), _MAX_PATH); szFileName.ReleaseBuffer(); nIndex = szFileName.ReverseFind('\\'); szFileName = szFileName.Left(nIndex); szFileName += _T("\\AutomationStartupOptions.txt"); CStdioFile StartupFile; if( StartupFile.Open(szFileName, CFile::modeCreate|CFile::modeWrite|CFile::typeText) ) { StartupFile.WriteString(szLine); StartupFile.Close(); }